﻿using System;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
    public Service () 
    {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    //[WebMethod]
    //public string HelloWorld() 
    //{
    //    return "Hello World";
    //}

    [WebMethod(Description = "求和的方法")]
    public double addition(double i, double j)
    {
        return i + j;
    }
    [WebMethod(Description = "求差的方法")]
    public double subtract(double i, double j)
    {
        return i - j;
    }
    [WebMethod(Description = "求积的方法")]
    public double multiplication(double i, double j)
    {
        return i * j;
    }
    [WebMethod(Description = "求商的方法")]
    public double division(double i, double j)
    {
        if (j != 0)
            return i / j;
        else
            return 0;
    } 
    
}
